package org.example.boot.usercenter.service;

import jakarta.servlet.http.HttpServletRequest;
import org.example.boot.usercenter.model.User;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * @author HEZHAOGUI
 * @description 针对表【user(用户表)】的数据库操作Service
 * @createDate 2025-01-01 14:12:15
 */
public interface UserService extends IService<User> {
    /**
     * 用户注册
     *
     * @param userAccount   用户账户
     * @param userPassword  用户密码
     * @param checkPassword 校验密码
     * @param planetCode 星球编码
     * @return 新用户id
     */
    Long userRegiser(String userAccount, String userPassword, String checkPassword,String planetCode);

    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @return user
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     *
     * @param user 要脱敏的用户信息
     * @return user
     */
    User getSafetyUser(User user);

    /**
     * 用户注销
     *
     * @param request 传入的request值
     */
    int uerLogout(HttpServletRequest request);
}
